<!--

Admin_Popup = {
	on : function() {
		$$('.delete_confirm').each(function(el) {
			var tmp = new Confirm(el);
			el.addEvent('click', function(evt) {
				evt = new Event(evt);
				evt.stop();
				tmp.show();
			});	
		});
	},
	off: function() {
		$$('.delete_confirm').each(function(el) {
			var tmp = new Confirm(el);
			el.removeEvents('click');
		});
	},
	toggle : function(e) {
		if ($('conf_toggle').hasClass('on')) {
			this.off();
			$('conf_toggle').toggleClass('on');
			$('conf_toggle').toggleClass('off');
			$('conf_toggle').setHTML('Off');
			return 0;
		}
		else {
			this.on();
			$('conf_toggle').toggleClass('off');
			$('conf_toggle').toggleClass('on');
			$('conf_toggle').setHTML('On');
			return 1;
		}
	}
};

// Seperated for readability
Admin_Editor = {
	instances: function() {
		var main_title = createEditor('.board_title', { url: BASE_URL + 'admin/settings/', fieldName: 'title', id:'' });
		var cat_title =  createEditor('.cat_name', { url: BASE_URL + 'category/admin/edit/', fieldName: 'name' });
		var for_title =  createEditor('.forum_title', { url: BASE_URL + 'forum/admin/edit_title/', fieldName: 'name' });
		var for_desc =  createEditor('.forum_description', { url: BASE_URL + 'forum/admin/edit_description/', fieldName: 'desc' });
		var top_title =  createEditor('.topic_title', { url: BASE_URL + 'topic/admin/edit_title/', fieldName: 'name' });

		var ret = [];
		[main_title, cat_title, for_title, for_desc, top_title].each(function(item) {
			ret.merge(item);
		});
		return ret;
	},
	on: function() {
		this.instances.each(function(obj) {
			obj.dom_handle.addEvent('click', function() {
				obj.editor.show();
			});
		});
	},
	off: function() {				
		this.instances.each(function(obj) {
			obj.dom_handle.removeEvents('click');
		});
	},
	toggle : function(e) {
		if ($('evt_toggle').hasClass('on')) {
			this.off();
			$('evt_toggle').toggleClass('on');
			$('evt_toggle').toggleClass('off');
			$('evt_toggle').setHTML('Off');
			return 0;
		}
		else {
			this.on();
			$('evt_toggle').toggleClass('off');
			$('evt_toggle').toggleClass('on');
			$('evt_toggle').setHTML('On');
			return 1;
		}
	}
};

//-->